import functionnodes.FunctionNode;
import data.Value;

/**
 * @author loaner
 */
class functionnodes.FunctionNodeCar extends FunctionNode {
	
	function FunctionNodeCar() {
		super();
		funcname = "car";
//		type = FunctionNode.MACRO;
	}
	
	public function reduceValues( scope:Object, values:Array ) : Value
	{
		//for now let's assume we're getting one Value object whose type is Value.XMLNODE
		var returnXML:XMLNode = values[ 0 ].raw();
		trace("CAR is starting with returnXML " + returnXML );
		returnXML = returnXML.cloneNode( true );
		returnXML = returnXML.firstChild;
		trace("CAR RETURNING " + returnXML );
		
		var returnval:Value = Evaluator.convertXMLtoValue( returnXML, scope );
		return returnval;
	}
		
}